<?php
/**
 * 验证服务类
 * created by.
 * User: EDZ
 * Date: 2020/12/22
 * TIME: 14:02
 */
namespace app\libaray\service\common;

trait HandleService {

    /**
     * 批量验证
     *
     * @param $arr
     * @param $err
     * @throws \Exception
     * @return bool
     * @author lyf
     * @date 2020-12-22
     */
    public static function batchValidation($arr,$err){
        for ($i = 0; $i < $arr; $i++){
            if ($arr[$i] == '') throw new \Exception($err);
        }
        return true;
    }
}